From 654d388a91a77005f95b1d466fe9e2c78e0fed44 Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 29 Sep 2009 22:09:36 +0000 Subject: [PATCH] Mathias adds dump-file, first-sector, last-sector,read-at-once options to Skytraq. --- reference/skytraq.bin | Bin 0 -> 4096 bytes skytraq.c | 262 +++++++++++++----- testo | 7 + vecs.c | 18 +- xmldoc/formats/options/delbin-gcsym.xml | 2 +- xmldoc/formats/options/skytraq-baud.xml | 3 + xmldoc/formats/options/skytraq-dump-file.xml | 3 + .../formats/options/skytraq-first-sector.xml | 12 + xmldoc/formats/options/skytraq-initbaud.xml | 4 + .../formats/options/skytraq-last-sector.xml | 5 + .../formats/options/skytraq-read-at-once.xml | 7 + .../options/skytraq-targetlocation.xml | 4 +- xmldoc/formats/skytraq-bin.xml | 3 + xmldoc/formats/skytraq.xml | 20 +- 14 files changed, 266 insertions(+), 84 deletions(-) create mode 100644 reference/skytraq.bin create mode 100644 xmldoc/formats/options/skytraq-baud.xml create mode 100644 xmldoc/formats/options/skytraq-dump-file.xml create mode 100644 xmldoc/formats/options/skytraq-first-sector.xml create mode 100644 xmldoc/formats/options/skytraq-initbaud.xml create mode 100644 xmldoc/formats/options/skytraq-last-sector.xml create mode 100644 xmldoc/formats/options/skytraq-read-at-once.xml create mode 100644 xmldoc/formats/skytraq-bin.xml diff --git a/reference/skytraq.bin b/reference/skytraq.bin new file mode 100644 index 0000000000000000000000000000000000000000..a1aa0834c1ed6b2353eb2ade31acea90fa30e3ca GIT binary patch literal 4096 zcmeH{NphP<4299n|EEZawiIVtWt(%5kq5-J^E}1zhBuCH|s4~3TtMbt#|X}dz>$- z`561jvuwJlgYd7N9L_(Isk|9^_-R9&dP|;sXnprfJy3qWtD}f_HTvXX?V`R?*AqX% z$EFeW)cL2H8eRkN zGrYw&Q71ddVa@4_-_Ps!F^7|uEO6?T z#lGi{z$IQ@dCWPd+R?{n@Dq>A7PrED+Sjr+eOI+pU#m66p2zSYKG1uBN4y7F-ACy; zL=W)N2{@WNflt1z^1V2};=T!Qj-KS(JACc0Hhnpd{Y~zu2gjyvfiuI(=et>cwf=$c z6VB=57wD$Gx9|twHy(PGk;hzRgXO-~i602ZmmYKQ`i8=*r})xkj&1$p|G4V4r9Quu% zdssk={MYoOZhj0t^Obq?%Om2{FOtXo=f83uv6fF6!-_8I#Ce- literal 0 HcmV?d00001 diff --git a/skytraq.c b/skytraq.c index 70dc6518b..607ca4f80 100644 --- a/skytraq.c +++ b/skytraq.c @@ -2,15 +2,10 @@ Serial download of track data from GPS loggers with Skytraq chipset. - 6) Add sample files (it's better when they're created by the "real" - application and not our own output) to reference/ along with - files in a well supported (preferably non-binary) format and - entries in our 'testo' program. This allows users of different - OSes and hardware to exercise your module. + Copyright (C) 2008-2009 Mathias Adam, m.adam (at) adamis.de - Copyright (C) 2008 Mathias Adam, m.adam (at) adamis.de - Copyright (C) 2008 J.C Haessig, jean-christophe.haessig (at) dianosis.org - Copyright (C) 2005 Robert Lipe, robertlipe@usa.net + 2008 J.C Haessig, jean-christophe.haessig (at) dianosis.org + 2009-09-06 | Josef Reisinger | Added "set target location", i.e. -i skytrag,targetlocation=: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,9 +20,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA - - - 2009-09-06 | Josef Reisinger | Added "set target location", i.e. -i skytrag,targetlocation=: */ #include @@ -38,8 +30,10 @@ #define MYNAME "skytraq" -#define SECTOR_SIZE 4096 #define TIMEOUT 5000 +#define SECTOR_SIZE 4096 +#define FULL_ITEM_LEN 18 +#define COMPACT_ITEM_LEN 8 /* Maximum number of chars to skip while waiting for a reply: */ #define RETRIES 250 @@ -58,28 +52,50 @@ #define MAX(X,Y) ((X) > (Y) ? (X) : (Y)) -static char *port; /* port name */ -static void *serial_handle; /* IO file descriptor */ -static int skytraq_baud = 0; /* detected baud rate */ +static char *port; /* port name */ +static void *serial_handle = 0; /* IO file descriptor */ +static int skytraq_baud = 0; /* detected baud rate */ +static gbfile *file_handle = 0; /* file descriptor (used by skytraq-bin format) */ -static char *opt_erase; /* erase after read? (0/1) */ -static char *opt_initbaud; /* baud rate used to init device */ -static char *opt_dlbaud; /* baud rate used for downloading tracks */ -static char *opt_read_at_once; /* number of sectors to read at once (Venus6 only) */ -static char *opt_set_location; /* set if the "targetlocation" options was used */ +static char *opt_erase = 0; /* erase after read? (0/1) */ +static char *opt_initbaud = 0; /* baud rate used to init device */ +static char *opt_dlbaud = 0; /* baud rate used for downloading tracks */ +static char *opt_read_at_once = 0; /* number of sectors to read at once (Venus6 only) */ +static char *opt_first_sector = 0; /* first sector to be read from the device (default: 0) */ +static char *opt_last_sector = 0; /* last sector to be read from the device (default: smart read everything) */ +static char *opt_dump_file = 0; /* dump raw data to this file (optional) */ +static char *opt_no_output = 0; /* disable output? (0/1) */ +static char *opt_set_location = 0; /* set if the "targetlocation" options was used */ static arglist_t skytraq_args[] = { { "erase", &opt_erase, "Erase device data after download", "0", ARGTYPE_BOOL, ARG_NOMINMAX }, - { "initbaud", &opt_initbaud, "Baud rate used to init device, 0=autodetect", + { "targetlocation", &opt_set_location, "Set location finder target location as lat,lng", + "", ARGTYPE_STRING, "", "" }, + { "initbaud", &opt_initbaud, "Baud rate used to init device (0=autodetect)", "0", ARGTYPE_INT, "4800", "230400" }, { "baud", &opt_dlbaud, "Baud rate used for download", "230400", ARGTYPE_INT, "4800", "230400" }, - { "read-at-once", &opt_read_at_once, "Number of sectors to read at once (Venus6 only)", + { "read-at-once", &opt_read_at_once, "Number of sectors to read at once (0=use single sector mode)", "255", ARGTYPE_INT, "0", "255" }, - { "targetlocation", &opt_set_location, "Set location finder target location as lat,lng", - "", ARGTYPE_STRING, "", "" }, + { "first-sector", &opt_first_sector, "First sector to be read from the device", + "0", ARGTYPE_INT, "0", "65535" }, + { "last-sector", &opt_last_sector, "Last sector to be read from the device (-1: smart read everything)", + "-1", ARGTYPE_INT, "-1", "65535" }, + { "dump-file", &opt_dump_file, "Dump raw data to this file", + NULL, ARGTYPE_OUTFILE, ARG_NOMINMAX }, + { "no-output", &opt_no_output, "Disable output (useful with e.g. erase or targetlocation)", + "0", ARGTYPE_BOOL, ARG_NOMINMAX }, + ARG_TERMINATOR +}; + +static +arglist_t skytraq_fargs[] = { + { "first-sector", &opt_first_sector, "First sector to be read from the file", + "0", ARGTYPE_INT, "0", "65535" }, + { "last-sector", &opt_last_sector, "Last sector to be read from the file (-1: read till empty sector)", + "-1", ARGTYPE_INT, "-1", "65535" }, ARG_TERMINATOR }; @@ -462,7 +478,7 @@ skytraq_get_log_buffer_status(gbuint32 *log_wr_ptr, gbuint16 *sectors_free, gbui /* reads 32-bit "middle-endian" fields */ static unsigned int me_read32(const unsigned char *p) { - return ((unsigned)be_read16(p+2) << 16) | ((unsigned)be_read16(p)); + return ((unsigned)be_read16(p+2) << 16) | ((unsigned)be_read16(p)); } struct read_state { @@ -473,8 +489,17 @@ struct read_state { long x, y, z; }; -static void state_init(struct read_state *pst) { - pst->route_head = NULL; +static void +state_init(struct read_state *pst) +{ + route_head *track; + + track = route_head_alloc(); + track->rte_name = xstrdup("SkyTraq tracklog"); + track->rte_desc = xstrdup("SkyTraq GPS tracklog data"); + track_add_head(track); + + pst->route_head = track; pst->wpn = 0; pst->tpn = 0; @@ -588,7 +613,7 @@ process_data_item(struct read_state *pst, const item_frame *pitem, int len) /* fall through: */ case 0x4: /* full item */ - if (len < 18) { + if (len < FULL_ITEM_LEN) { db(1, MYNAME ": Not enough bytes in sector for a full item.\n"); return res_ERROR; } @@ -610,11 +635,11 @@ process_data_item(struct read_state *pst, const item_frame *pitem, int len) f.x, f.y, f.z, ITEM_SPEED(pitem)); - res = 18; + res = FULL_ITEM_LEN; break; case 0x8: /* compact item */ - if (len < 8) { + if (len < COMPACT_ITEM_LEN) { db(1, MYNAME ": Not enough bytes in sector for a compact item.\n"); return res_ERROR; } @@ -635,7 +660,7 @@ process_data_item(struct read_state *pst, const item_frame *pitem, int len) pst->y += c.dy; pst->z += c.dz; - res = 8; + res = COMPACT_ITEM_LEN; break; default: @@ -643,7 +668,7 @@ process_data_item(struct read_state *pst, const item_frame *pitem, int len) return 0; } - if (res == 8 || res == 18) { + if (res == COMPACT_ITEM_LEN || res == FULL_ITEM_LEN) { ECEF_to_LLA(pst->x, pst->y, pst->z, &lat, &lon, &alt); // GPS_Math_XYZ_To_WGS84LatLonH(&lat, &lon, &alt, pst->x, pst->y, pst->z); tpt = make_trackpoint(pst, lat, lon, alt); @@ -671,14 +696,16 @@ process_data_sector(struct read_state *pst, const gbuint8 *buf, int len) for (plen = 0; plen < len && buf[plen] != 0xFF; plen += ilen) { ilen = process_data_item(pst, (item_frame*)&buf[plen], len-plen); if (ilen <= 0) { - fatal(MYNAME ": Error processing data item (%i)\n", ilen); + fatal(MYNAME ": Error %i while processing data item #%i (starts at %i)\n", + ilen, pst->tpn, plen); } } return plen; } -static int /* returns number of bytes read, negative values indicate errors */ +/* Note: the buffer is being padded with 0xFFs if necessary so there are always SECTOR_SIZE valid bytes */ +static int skytraq_read_single_sector(int sector, gbuint8 *buf) { gbuint8 MSG_LOG_SECTOR_READ_CONTROL[2] = { 0x1B, sector }; @@ -743,7 +770,7 @@ skytraq_read_single_sector(int sector, gbuint8 *buf) i = i-j; db(3, "Received %i bytes of log data\n", i); -#define SINGLE_READ_WORKAROUND +//#define SINGLE_READ_WORKAROUND #ifdef SINGLE_READ_WORKAROUND gbser_set_speed(serial_handle, skytraq_baud); rd_char(&errors); @@ -766,7 +793,7 @@ skytraq_read_single_sector(int sector, gbuint8 *buf) buf[i] = 0xFF; } - return i; + return res_OK; } static int @@ -819,18 +846,20 @@ skytraq_read_multiple_sectors(int first_sector, int sector_count, gbuint8 *buf) } static void -skytraq_read_tracks(route_head *track) +skytraq_read_tracks(void) { struct read_state st; gbuint32 log_wr_ptr; gbuint16 sectors_free, sectors_total, /*sectors_used_a, sectors_used_b,*/ sectors_used; - int i, t, s, rc, got_bytes; + int i, t, s, rc, got_sectors, total_sectors_read = 0; int read_at_once = MAX(atoi(opt_read_at_once), 1); - int sectors_read, multi_read_supported = 1; + int opt_first_sector_val = atoi(opt_first_sector); + int opt_last_sector_val = atoi(opt_last_sector); + int multi_read_supported = 1; gbuint8 *buffer = NULL; + gbfile *dumpfile = NULL; state_init(&st); - st.route_head = track; if (skytraq_get_log_buffer_status(&log_wr_ptr, §ors_free, §ors_total) != res_OK) { fatal(MYNAME ": Can't get log buffer status\n"); @@ -839,6 +868,10 @@ skytraq_read_tracks(route_head *track) db(1, MYNAME ": Device status: free sectors: %i / total sectors: %i / %i%% used / write ptr: %i\n", sectors_free, sectors_total, 100 - sectors_free*100 / sectors_total, log_wr_ptr); + if (opt_first_sector_val >= sectors_total) { + db(1, "Warning: sector# specified by option first-sector (%i) is beyond reported total sector count (%i)", + opt_first_sector_val, sectors_total); + } /* Workaround: sectors_free is sometimes reported wrong. Tried to use log_wr_ptr as an indicator for how many sectors are currently used. However this isn't correct in every case too. The current read logic is aware of that so this shouldn't be necessary anymore. @@ -850,19 +883,34 @@ skytraq_read_tracks(route_head *track) } sectors_used = MAX(sectors_used_a, sectors_used_b); */ - sectors_used = sectors_total - sectors_free + 1 /*+5*/; + if (opt_last_sector_val < 0) { + sectors_used = sectors_total - sectors_free + 1 /*+5*/; + if (opt_first_sector_val >= sectors_used) { + sectors_used = opt_first_sector_val + 1; + } + } else { + sectors_used = opt_last_sector_val; + if (opt_last_sector_val >= sectors_total) { + db(1, "Warning: sector# specified by option last-sector (%i) is beyond reported total sector count (%i)", + opt_last_sector_val, sectors_total); + } + } - while (read_at_once > 0 && !(buffer = malloc(SECTOR_SIZE*read_at_once+sizeof(SECTOR_READ_END)+6))) { + while (read_at_once > 0 && !(buffer = xmalloc(SECTOR_SIZE*read_at_once+sizeof(SECTOR_READ_END)+6))) { read_at_once--; } if (read_at_once == 0) fatal(MYNAME ": Can't allocate buffer for reading\n"); + if (opt_dump_file) { + dumpfile = gbfopen(opt_dump_file, "w", MYNAME); + } + db(1, MYNAME ": Reading log data from device...\n"); - for (i = 0; i < sectors_used; i += sectors_read) { - for (t = 0, got_bytes = 0; (t < SECTOR_RETRIES) && (got_bytes <= 0); t++) { + for (i = opt_first_sector_val; i < sectors_used; i += got_sectors) { + for (t = 0, got_sectors = 0; (t < SECTOR_RETRIES) && (got_sectors <= 0); t++) { if (atoi(opt_read_at_once) == 0 || multi_read_supported == 0) { rc = skytraq_read_single_sector(i, buffer); - if (rc > 0) got_bytes = rc; + if (rc == res_OK) got_sectors = 1; } else { /* Try to read read_at_once sectors at once. * If tere aren't any so many interesting ones, read the remainder (sectors_used-i). @@ -873,7 +921,7 @@ skytraq_read_tracks(route_head *track) rc = skytraq_read_multiple_sectors(i, read_at_once, buffer); switch (rc) { case res_OK: - got_bytes = read_at_once*SECTOR_SIZE; + got_sectors = read_at_once; read_at_once = MIN(read_at_once*2, atoi(opt_read_at_once)); break; @@ -889,29 +937,41 @@ skytraq_read_tracks(route_head *track) } } } - if (got_bytes <= 0) { + if (got_sectors <= 0) { fatal(MYNAME ": Error reading sector %i\n", i); } - sectors_read = (got_bytes-1)/SECTOR_SIZE + 1; - for (s = 0; s < sectors_read; s++) { + total_sectors_read += got_sectors; + + if (dumpfile) { + gbfwrite(buffer, SECTOR_SIZE, got_sectors, dumpfile); + } + + if (*opt_no_output == '1') { + continue; // skip decoding + } + + for (s = 0; s < got_sectors; s++) { db(4, MYNAME ": Decoding sector #%i...\n", i+s); - rc = process_data_sector(&st, buffer+s*SECTOR_SIZE, MIN(got_bytes, SECTOR_SIZE)); + rc = process_data_sector(&st, buffer+s*SECTOR_SIZE, SECTOR_SIZE); if (rc == 0) { - db(1, MYNAME ": Empty sector encountered: apparently only %i sectors " + db(1, MYNAME ": Empty sector encountered: apparently only %i sectors are " "used but device reported %i.\n", i+s, sectors_used); i = sectors_used; /* terminate to avoid reading stale data still in the logger */ break; - } else if (rc >= (4096-18) && i+s+1 >= sectors_used && i+s+1 < sectors_total) { - db(1, MYNAME ": Last sector is nearly full, reading one more sector (some " - "devices report free sector count wrong)\n"); + } else if (rc >= (4096-FULL_ITEM_LEN) && i+s+1 >= sectors_used && i+s+1 < sectors_total) { + db(1, MYNAME ": Last sector is nearly full, reading one more sector\n"); sectors_used++; } } } free(buffer); - db(1, MYNAME ": Got %i trackpoints.\n", st.tpn); + db(1, MYNAME ": Got %i trackpoints from %i sectors.\n", st.tpn, total_sectors_read); + + if (dumpfile) { + gbfclose(dumpfile); + } } static int @@ -1058,23 +1118,21 @@ static void skytraq_read(void) { int dlbaud; - route_head *track; - - if (*opt_set_location) { - skytraq_set_location(); - return; - } - track = route_head_alloc(); - track->rte_name = xstrdup("SkyTraq tracklog"); - track->rte_desc = xstrdup("SkyTraq GPS tracklog data"); - track_add_head(track); dlbaud = atoi(opt_dlbaud); if (dlbaud != skytraq_baud) { skytraq_set_baud(dlbaud); } - skytraq_read_tracks(track); + if (*opt_set_location) { + skytraq_set_location(); +// return; + } + + // read device unless no-output=1 and dump-file=0 (i.e. no data needed at all) + if (*opt_no_output == '0' || opt_dump_file != NULL) { + skytraq_read_tracks(); + } if (*opt_erase == '1') { skytraq_erase(); @@ -1084,6 +1142,60 @@ skytraq_read(void) skytraq_system_restart(); } +static void +file_init(const char *fname) +{ + db(1, "Opening file...\n"); + if ((file_handle = gbfopen(fname, "rb", MYNAME)) == NULL) { + fatal(MYNAME ": Can't open file '%s'\n", fname); + } +} + +static void +file_deinit(void) +{ + db(1, "Closing file...\n"); + gbfclose(file_handle); + file_handle = NULL; +} + +static void +file_read(void) +{ + struct read_state st; + int rc, got_bytes; + int opt_first_sector_val = atoi(opt_first_sector); + int opt_last_sector_val = atoi(opt_last_sector); + int sectors_read; + gbuint8 *buffer; + + state_init(&st); + buffer = xmalloc(SECTOR_SIZE); + + if (opt_first_sector_val > 0) { + db(4, MYNAME ": Seeking to first-sector index %i\n", opt_first_sector_val*SECTOR_SIZE); + gbfseek(file_handle, opt_first_sector_val*SECTOR_SIZE, SEEK_SET); + } + + db(1, MYNAME ": Reading log data from file...\n"); + sectors_read = 0; + while ((got_bytes = gbfread(buffer, 1, SECTOR_SIZE, file_handle)) > 0) { + db(4, MYNAME ": Decoding sector #%i...\n", sectors_read++); + rc = process_data_sector(&st, buffer, got_bytes); + if (opt_last_sector_val < 0) { + if (rc < (4096-FULL_ITEM_LEN)) { + db(1, MYNAME ": Empty sector encountered, terminating.\n"); + break; + } + } else if (sectors_read-1 >= opt_last_sector_val) { + db(1, MYNAME ": desired last-sector #%i reached, terminating.\n", sectors_read-1); + break; + } + } + free(buffer); + db(1, MYNAME ": Got %i trackpoints from %i sectors.\n", st.tpn, sectors_read); +} + /**************************************************************************/ // capabilities below means: we can only read tracks @@ -1105,4 +1217,22 @@ ff_vecs_t skytraq_vecs = { skytraq_args, CET_CHARSET_UTF8, 1 /* master process: don't convert anything */ }; + +ff_vecs_t skytraq_fvecs = { + ff_type_file, + { + ff_cap_read /* waypoints */, + ff_cap_read /* tracks */, + ff_cap_none /* routes */ + }, + file_init, + NULL, + file_deinit, + NULL, + file_read, + NULL, + NULL, + skytraq_fargs, + CET_CHARSET_UTF8, 1 /* master process: don't convert anything */ +}; /**************************************************************************/ diff --git a/testo b/testo index 2a3ffae68..1ba38da0a 100755 --- a/testo +++ b/testo @@ -1632,4 +1632,11 @@ compare ${REFERENCE}/route/naviguide.gpx ${TMPDIR}/naviguide.gpx gpsbabel -i vpl -f ${REFERENCE}/track/vpl_reference.vpl -o gpx -F ${TMPDIR}/vpl_reference.gpx compare ${TMPDIR}/vpl_reference.gpx ${REFERENCE}/track/vpl_reference.gpx +# +# Skytraq logger tests +# +rm -f ${TMPDIR}/skytraq.* +gpsbabel -t -w -i skytraq-bin -f ${REFERENCE}/skytraq.bin -o gpx -F ${TMPDIR}/skytraq.gpx +compare ${TMPDIR}/skytraq.gpx ${REFERENCE}/skytraq.gpx + exit 0 diff --git a/vecs.c b/vecs.c index 09a9b5d3c..8fda5462f 100644 --- a/vecs.c +++ b/vecs.c @@ -100,6 +100,7 @@ extern ff_vecs_t quovadis_vecs; extern ff_vecs_t saroute_vecs; extern ff_vecs_t shape_vecs; extern ff_vecs_t skytraq_vecs; +extern ff_vecs_t skytraq_fvecs; #if CSVFMTS_ENABLED extern ff_vecs_t stmsdf_vecs; #endif @@ -957,13 +958,18 @@ vecs_t vec_list[] = { "DeLorme PN-20/PN-30/PN-40 USB protocol", NULL }, - { &skytraq_vecs, "skytraq", - "SkyTraq Venus 5/6 GPS Data Logger Download", + "SkyTraq Venus based loggers (download)", NULL }, + { + &skytraq_fvecs, + "skytraq-bin", + "SkyTraq Venus based loggers Binary File Format", + "bin" + }, #endif // MAXIMAL_ENABLED { NULL, @@ -989,6 +995,12 @@ init_vecs(void) } } +int +is_integer(const char *c) +{ + return isdigit(c[0]) || ((c[0] == '+' || c[0] == '-') && isdigit(c[1])); +} + void exit_vecs( void ) { @@ -1002,7 +1014,7 @@ exit_vecs( void ) for ( ap = vec->vec->args; ap->argstring; ap++ ) { if ( ap->defaultvalue && ( ap->argtype == ARGTYPE_INT ) && - ! isdigit(ap->defaultvalue[0])) { + ! is_integer(ap->defaultvalue)) { warning("%s: not an integer\n", ap->argstring); } if ( ap->argvalptr ) { diff --git a/xmldoc/formats/options/delbin-gcsym.xml b/xmldoc/formats/options/delbin-gcsym.xml index 777535fd2..0475b4986 100644 --- a/xmldoc/formats/options/delbin-gcsym.xml +++ b/xmldoc/formats/options/delbin-gcsym.xml @@ -5,4 +5,4 @@ the device. If false, any icon data present in the source data will be used instead. If you've taken control of the icon data, you are responsible for providing valid icons; GPSBabel will make no attempt to purify what gets sent. - + diff --git a/xmldoc/formats/options/skytraq-baud.xml b/xmldoc/formats/options/skytraq-baud.xml new file mode 100644 index 000000000..91f4f219a --- /dev/null +++ b/xmldoc/formats/options/skytraq-baud.xml @@ -0,0 +1,3 @@ +The following baud rates can be used: 4800, 9600, 19200, 38400, 57600, 115200, 230400. +Note that your logger might support only a subset of them (especially 230400 which isn't documented +in the chipset manual, though there are devices that are capable of this speed). diff --git a/xmldoc/formats/options/skytraq-dump-file.xml b/xmldoc/formats/options/skytraq-dump-file.xml new file mode 100644 index 000000000..52bb28929 --- /dev/null +++ b/xmldoc/formats/options/skytraq-dump-file.xml @@ -0,0 +1,3 @@ +Writes raw data as it is read from the logger to the file given as this option's argument +(additional to decoding it as usual). The binary files can be read and decoded by skytraq-bin format. +Mainly useful for debugging/development purposes. diff --git a/xmldoc/formats/options/skytraq-first-sector.xml b/xmldoc/formats/options/skytraq-first-sector.xml new file mode 100644 index 000000000..770b941f2 --- /dev/null +++ b/xmldoc/formats/options/skytraq-first-sector.xml @@ -0,0 +1,12 @@ +The logger's memory is organized in sectors, serially numbered starting at 0. Each sector takes 4096 bytes of data. +Typical devices hold about 250 sectors. The memory is always filled from sector 0 on, until it is full or the device being +erased again by the user. + +Normally you can safely omit this option. However, it might be useful to read data from erased devices: we observed +that on erase, only the first two sectors are actually cleared. The following example shows how to read the remaining data: + + + + Command showing how to read data from an erased device + gpsbabel -i skytraq,first-sector=2 -f /dev/ttyUSB0 -o gpx -F out.gpx + diff --git a/xmldoc/formats/options/skytraq-initbaud.xml b/xmldoc/formats/options/skytraq-initbaud.xml new file mode 100644 index 000000000..75b012239 --- /dev/null +++ b/xmldoc/formats/options/skytraq-initbaud.xml @@ -0,0 +1,4 @@ +The "initbaud" option might be helpful if autodetection fails or takes too long. With this option you +can tell GPSBabel the baud rate the device is currently set to. In contrast, the option "baud" specifies +the rate at which the actual download should take place. If it is different than "initbaud" (or the autodetected +rate, if initbaud wasn't given), the initial setting will be restored after finishing the download. diff --git a/xmldoc/formats/options/skytraq-last-sector.xml b/xmldoc/formats/options/skytraq-last-sector.xml new file mode 100644 index 000000000..836f46e23 --- /dev/null +++ b/xmldoc/formats/options/skytraq-last-sector.xml @@ -0,0 +1,5 @@ +A value of -1 (the default) enables automatic mode, i.e. reading is stopped when an empty sector is +encountered. +We observed that sometimes the device doesn't report the correct number of used sectors, which confuses the Windows +software, so that it might not get all trackpoints. +In contrast, our algorithm ensures that everything is being read (please report if it doesn't work for you). diff --git a/xmldoc/formats/options/skytraq-read-at-once.xml b/xmldoc/formats/options/skytraq-read-at-once.xml new file mode 100644 index 000000000..7283235cb --- /dev/null +++ b/xmldoc/formats/options/skytraq-read-at-once.xml @@ -0,0 +1,7 @@ +If read-at-once >= 1, batch mode is enabled with that many sectors being read at a time. +A value of zero disables batch mode and switches to single read mode. Not all devices support batch mode; in that case +gpsbabel automatically switches to single read mode. + +Under normal circumstances, the larger this number the faster the transfer. +Reducing read-at-once or even switching to single sector mode might help when you get +transmission errors/aborts. diff --git a/xmldoc/formats/options/skytraq-targetlocation.xml b/xmldoc/formats/options/skytraq-targetlocation.xml index b00e9f633..77d5f2746 100644 --- a/xmldoc/formats/options/skytraq-targetlocation.xml +++ b/xmldoc/formats/options/skytraq-targetlocation.xml @@ -10,9 +10,9 @@ gpsbabel -i skytraq,targetlocation=12.34:-56.78 -f /dev/ttyUSB 0 -o unicsv -F - Sets latitude and longitude of the location finder to N12.34 and - W56.78 re ectivly. + W56.78 respectively. The arrows on the device will point you to this location as soon as - it h as a satlitte fix. + it has a satellite fix. diff --git a/xmldoc/formats/skytraq-bin.xml b/xmldoc/formats/skytraq-bin.xml new file mode 100644 index 000000000..76b9391a3 --- /dev/null +++ b/xmldoc/formats/skytraq-bin.xml @@ -0,0 +1,3 @@ +Reads the binary format of GPS data loggers based on Skytraq Venus 5 and Venus 6 chipsets. +This can be used to read raw binary files created with the "dump-file" option of the skytraq format. +Mainly useful for debugging/development purposes. diff --git a/xmldoc/formats/skytraq.xml b/xmldoc/formats/skytraq.xml index 787104baa..0013e3868 100644 --- a/xmldoc/formats/skytraq.xml +++ b/xmldoc/formats/skytraq.xml @@ -1,4 +1,5 @@ Serial download protocol for GPS data loggers based on Skytraq Venus 5 and Venus 6 chipsets. +This chipset is used by a number of devices from different manufacturers. If your logger came with the Windows software iTravelTech GPS Photo Tagger, chances are that you can use this format to read its memory. @@ -62,20 +63,15 @@ use this format to read its memory. gpsbabel -i skytraq,erase -f /dev/ttyUSB0 -o gpx -F out.gpx + + Command showing skytraq erasing the logger without download on Linux + gpsbabel -i skytraq,erase,no-output -f /dev/ttyUSB0 + + If available, reading the logger using bluetooth should also work. However, many devices support only one specific baud rate over bluetooth, e.g. 9600: Command showing skytraq download tracks via bluetooth on Linux - rfcomm bind 0 <bdaddr> - gpsbabel -i skytraq,baud=9600 -f /dev/rfcomm0 -o gpx -F out.gpx + rfcomm bind 0 <bdaddr> + gpsbabel -i skytraq,baud=9600 -f /dev/rfcomm0 -o gpx -F out.gpx - -The "initbaud" option might be helpful if autodetection fails or takes too long. With this option you -can tell GPSBabel the baud rate the device is currently set to. In contrast, the option "baud" specifies -the rate at which the actual download should take place. If it is different than "initbaud" (or the autodetected -rate, if initbaud wasn't given), the initial setting will be restored after finishing the download. - -If read-at-once >= 1, batch mode is enabled with that many sectors being read at a time. -Under normal circumstances, the larger this number the faster the transfer. -Reducing "read-at-once" might help when you get transmission errors/aborts. -This option only applies to Venus 6 devices; Venus 5 devices always use read-at-once = 0. -- 2.30.2